<h1>Listing vlan_details</h1>

<%= link_to 'New vlan_detail', new_vlan_detail_path %>

<table>
  <tr>
    <th>Colo</th>
    <th>Vlan</th>
    <th>Vlan #</th>
    <th>Subnet</th>
    <th>Subnet V6</th>
    <th>Total v4 IP</th>
    <th>Used v4 IP</th>
    <th>Percentage v4</th>
    <th>Actions</th>
  </tr>

<% for vlan_detail in @vlan_details.sort_by { |a| [a.colo.name,a.vlan.name] } %>
  <tr class=<%= cycle('row_odd','row_even')%> >
    <td><%=h vlan_detail.colo.name %></td>
    <td><%=h vlan_detail.vlan.name %></td>
    <td><%=h vlan_detail.vlan.vlan_number %></td>
    <td><%=h vlan_detail.subnet %></td>
    <td><%=h vlan_detail.subnet_v6 %></td>
    <td><%=h @utils[vlan_detail.id]['total'] %></td>
    <td><%=h @utils[vlan_detail.id]['used'] %></td>
    <td><%=h @utils[vlan_detail.id]['prct_used'] %>%</td>
    <td><%= link_to 'Edit', edit_vlan_detail_path(vlan_detail) %> |
    <%= link_to 'Hosts', :id => vlan_detail, :action => "vlan_hosts"%> |
    <%= link_to 'Destroy', vlan_detail, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New vlan_detail', new_vlan_detail_path %>
